class Solution {
public:

    double len(double x1,double y1,double x2,double y2)
    {
        return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    }

    vector<vector<int>> g;
    vector<bool> vis;
    int maximumDetonation(vector<vector<int>>& bombs) {
        int n = bombs.size();
        g.resize(n);
        vis.resize(n,false);
        int ans = 0;

        //建图
        for(int i = 0;i < n;i++)
        {
            //i->j ???
            for(int j = 0;j < n;j++)
            {
                if(i == j) continue;
                int x1 = bombs[i][0],y1 = bombs[i][1];
                double r = bombs[i][2];
                int x2 = bombs[j][0],y2 = bombs[j][1];
                if(len(x1,y1,x2,y2) <= r)
                {
                    g[i].push_back(j);
                }
            }
        }

        for(int i = 0;i < n;i++)
        {
            for(int j = 0;j < g[i].size();j++)
            {
                cout << g[i][j] << " ";
            }
            cout << endl;
        }
        int curans = 0;

        auto dfs = [&](this auto&& dfs,int cur)->int
        {
            vis[cur] = true;
            int cnt = 1;            ans = max(ans,curans);
            for(auto& next : g[cur])
            {
                if(vis[next]) continue;
                cnt += dfs(next);
            }
            return cnt;
        };

        for(int i = 0;i < n;i++)
        {
            ranges::fill(vis,false);
            ans = max(ans,dfs(i));
        }
        return ans;
    }
};